﻿#pragma once
#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include<stdbool.h>
#include<time.h>
#define pos_x 24
#define pos_y 5
#define wall L'※'
#define food0 L'▶'
#define food1 L'★'
#define food2 L'●'
#define food3 L'◆'
#define food4 L'■'
#define food5 L'◇'
#define food6 L'▲'
#define food7 L'□'
#define food8 L'▼'
#define food9 L'◀'
#define body L'◎'


enum dirction {
	up=1,
	down,
	left,
	right,
};
enum game_Status{
	ok,
	kill_by_wall,
	kill_by_self,
	end_normal,
};
typedef struct snakenode {
	int x;
	int y;
	struct snakenode* next;
}snakenode;

typedef struct snake {
	snakenode* psnake;
	snakenode* pfood;
	enum game_Status status;
	enum dirction dir;
		int foodscore;
		int all_score;
		int sleep_time;

}snake;
void game_start(snake* ps);//开始
void setpos(short x, short y);
void welcomegame();
 void print_map();
 void initsnake(snake* ps);
 void  set_food(snake* ps);
 void game_run(snake* ps);//运行
 void snake_pause();
 void printhelpinfo();
 int nextisfood(snakenode* p, snake* ps);
 void eatfood(snakenode* p, snake* ps);
 void noeatfood(snakenode* p, snake* ps);
 void killbywall(snake* ps);
 void killbyself(snake* ps);
 void endgame(snake* ps);//结束
